import { setLocalStorage, getLocalStorage } from './storage';

const accessTokenKey = 'access_token';

// Auth
export function getAuthHeader() {
  const accessToken = getLocalStorage(accessTokenKey);
  return ({
    headers: {
      Accept: 'application/json',
      Authorization: `Bearer ${accessToken}`,
      'Content-Type': 'application/json',
    },
  });
}

export function saveToken(accessToken) {
  setLocalStorage(accessTokenKey, accessToken);
}
